package com.seari.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.seari.bean.DaduhuiBean;
import com.seari.pojo.MessageBean;
import com.seari.service.DaduhuiDataService;
import com.seari.utils.StringHelper;



@RestController
@RequestMapping("/sendData")
public class MetroDataController
{
	public static final String METRO_FLOW_KEY = "metroData";
	
	@Autowired
	private DaduhuiDataService daduhuiDataService;
	
	@RequestMapping("/metroData")
	public MessageBean metroData(HttpServletRequest request,@RequestBody DaduhuiBean daduhuiBean)
	{
		System.out.println("do metro data method");
		MessageBean messageBean = new MessageBean();
		messageBean.setMessage(StringHelper.MESSAGE_TYPE_ERROR);
		try
		{
			daduhuiDataService.setFlowdata(daduhuiBean);
			messageBean.setMessage(StringHelper.MESSAGE_TYPE_SUCCESS);
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		return messageBean;
	}
}
